
Sparse Self-Attention, Patch Tokenization, and Multi-Horizon Scaling
Sub-Quadratic Sparsity, Conv1D Distilling, and Modern Time-Series Mixers
1 The Core Problem
Full self-attention computes all \(L_Q^2\) pairwise time-step dots—slow and prone to overfitting noise when most queries attend almost uniformly and only a few active queries lock onto turning points.
- Sub-Quadratic Sparsity (\(\mathcal{O}(L_Q \ln L_Q)\)): See why ProbSparse activates only on sufficiently long lookbacks (\(L_Q = 96 \implies u = 14\)).
- One-Shot Decoding: Predict all \(H=16\) horizons in one pass to stop autoregressive error compounding.
- Modern Scaling Pivot: Compare sparse point attention against patch tokenization, lightweight linear mixers, and sparse-MoE foundation models.
2 Step 1: ProbSparse Selection, Distilling, and Patch Scaling
ProbSparse ranks each query’s departure from uniform attention via its max-mean sparsity gap and computes exact attention only for the top \(u\) queries:
\[\overline{M}(\mathbf{q}_i, \mathbf{K}) = \max_{j}\!\left\{\frac{\mathbf{q}_i \mathbf{k}_j^\top}{\sqrt{d_k}}\right\} - \frac{1}{L_K}\sum_{j=1}^{L_K}\frac{\mathbf{q}_i \mathbf{k}_j^\top}{\sqrt{d_k}}, \qquad u = \lceil c \ln L_Q \rceil.\]
- Non-Degeneracy Condition: Short windows (\(L_Q=10, c=5 \implies u=12>10\)) collapse to 100% full attention. At \(L_Q=96, c=3\), ProbSparse retains \(u=14\) active queries (\(14.6\%, M^*=6.00\)) and replaces \(82\) lazy queries with \(\bar{\mathbf{V}}\).
- Distilling \(\to\) Patching:
Conv1D+MaxPool1Dhalving (\(96 \to 48 \to 24\)) cuts latency from \(3.12\) to \(1.84\text{ ms/batch}\). Modern patch tokenization (\(P=16 \to 6\) tokens) pushes compression even further to \(\mathcal{O}((L/P)^2)\) while preserving local trend geometry.

3 Step 2: Multi-Horizon Ablation and Linear vs. Foundation Regimes
Across 4-channel OHLC bars (\(H = 1\text{–}16\), \(5\) seeds, strict 70/15/15 split):
- One-Shot Decoding Beats Rollout & Full Attention: Raw prices follow the \(\sigma_1\sqrt{H}\) martingale bound (\(\$1.629 \to \$7.085\)). Within neural architectures, ProbSparse +
Conv1Ddistilling slashes \(H=16\) MSE by \(33.1\%\) vs. recursive Seq2Seq LSTMs (\(\$7.14\) vs. \(\$8.67\)) and \(35.5\%\) vs. Full Transformers (\(\$7.14\) vs. \(\$8.89\)). - Consistent Width Gain:
Conv1Ddistilling improves every width \(d_{\mathrm{model}} \in \{64\dots 512\}\), peaking on validation at \(d_{\mathrm{model}}=256\) (\(\$1.639\) vs. \(\$1.693\)). - Frontier Consensus: On a single noisy series, lightweight channel-independent linear or patch mixers rival large Transformers; patched time-series foundation models with Sparse Mixture-of-Experts win on zero-shot cross-domain transfer.

| Architecture (\(L_Q=96\)) | Complexity | \(H=1\) | \(H=16\) | Lesson |
|---|---|---|---|---|
| Random Walk Baseline | \(\mathcal{O}(1)\) | \(1.629\) | \(7.085\) | Martingale \(\sigma_1\sqrt{H}\) bound |
| ProbSparse + Distill (\(d=256\)) | \(u=14/96\) (\(1.84\text{ ms}\)) | \(1.639 \pm 0.001\) | \(7.136 \pm 0.028\) | \(-33.1\%\) \(H=16\) MSE vs. LSTM |
| ProbSparse (No Distill) | \(u=14/96\) (\(2.41\text{ ms}\)) | \(1.693 \pm 0.004\) | \(7.516 \pm 0.064\) | Higher multi-step variance |
| Recursive Seq2Seq LSTM | Autoregressive | \(1.631\) | \(8.667\) | Rollouts compound error |
| Full-Attention Transformer | \(96/96\) (\(3.12\text{ ms}\)) | \(1.667 \pm 0.002\) | \(8.888 \pm 0.142\) | Dense pairs overfit noise |
4 Open Research Directions
| Track | Frontier Question | Starting Toolkit |
|---|---|---|
| 1. Constrained Bar Decoders | Do positive softplus increment heads guarantee \(\mathrm{Low} \le \min(O,C) \le \max(O,C) \le \mathrm{High}\) while reducing joint error? | Differentiable Constraints, PyTorch |
| 2. Patch Mixers vs. Attention | Where is the exact crossover between micro-linear/patch mixers and sparse attention on periodic energy vs. noisy financial data? | Patch Time Mixers, Diebold-Mariano Tests |
| 3. Pruned Foundation Models | Can structured pruning compress zero-shot patched foundation models to edge latency without losing regime generalization? | Time-Series Foundation Models, Pruning |